﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApplication1
{
    public class PageBase : System.Web.UI.Page
    {
        protected void Page_Error(object sender, EventArgs args)
        {
            //获取最新的异常信息
            var ex = Server.GetLastError();
            //记录异常信息
            log4net.ILog log = (log4net.ILog)log4net.LogManager.GetLogger("LogToSqlite");
            log.Error(ex.Message, ex);
            //清空异常信息
            Server.ClearError();
        }
    }
}
